package org.zachary.agent.infrastructure.repository;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface InitDimensionAndRankingTableMapper {
    static final String QueryParameter_Dimension="总信用分";
    @Insert("INSERT INTO credit_score_dimension (user_id,dimension_type) VALUES (#{userId},'基本信息'),(#{userId},'信用生活'),(#{userId},'信用商业'),(#{userId},'亲社会行为'),(#{userId},'总信用分')")
    void initDimensionTable(@Param("userId") Integer userId);

    @Select("Select csd.dimension_score FROM  credit_score_dimension csd WHERE user_id=${userId} and dimension_type='总信用分'")
    Integer getUserCreditScore(@Param("userId") Integer userId);
}